package c5.Example4;

public class example4 {
    public static void main(String[] args) {
        String s= "itcast";
        System.out.println("jiangit替换为cn.it的结果:"+s.replace("it","cn.it"));
        String s1 ="    i t c a s t     ";
        System.out.println("去除字符串两端空格后的结果:"+s.trim());
        System.out.println("去除字符串中所有空格后的结果:"+s1.replace(" ",""));
    }
}
